//
//  WalletTool.h
//  Bees
//
//  Created by NowYouCanSee on 2018/12/27.
//  Copyright © 2018 xiaohan. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "XHDataBaseManager.h"
#import "TDTouchID.h"

NS_ASSUME_NONNULL_BEGIN
typedef void(^ResultBlock)(BOOL result,NSString*pwd) ;
@interface WalletTool : NSObject
@property (nonatomic,strong) NSMutableDictionary*walletUseFingerprint;
@property (nonatomic,strong) NSString* walletPwd;

@property (nonatomic,assign) BOOL useFingerprint;
@property (nonatomic,assign) BOOL isSetFingerprint;
@property (nonatomic,assign) BOOL useSelfInput;
///第一次打开APP
@property (nonatomic,assign) BOOL onceOpenApp;

SINGLETON_FOR_HEADER(WalletTool)
///验证密码得到私钥
+ (void)checkPrivateInputPasswordWith:(Wallet*)wallet complete:(void(^)(BOOL result,NSString *privateKey))complete;
///在使用dapp时候输入密码签名
+ (void)checkPrivateInputDapp:(DappInfo*)dappInfo signatureModel:(SignatureModel*)signatureModel PasswordWith:(Wallet*)wallet complete:(void(^)(BOOL result,NSString *privateKey,SignatureModel*signatureModel))complete;
///手动验证钱包密码
+ (void)checkInputPasswordWith:(Wallet*)wallet complete:(ResultBlock)complete;
///改变当前选择的钱包
+ (void)setCurrentWallet:(nullable Wallet *)wallet;
///当删除当前选择改变当前选择的钱包
+ (void)changeCurrentWallet;
///弹出验证密码
+ (void)alertCheckPasswordIsNeedShowUseFingerprint:(BOOL)needUseFingerprint Wallet:(Wallet*)wallet complete:(ResultBlock)complete;;

///是否使用指纹
+ (BOOL)isUseFingerprintCurrentWallet:(Wallet *)wallet;
+ (void)useFingerprintCurrentWallet:(Wallet *)wallet complete:(ResultBlock)complete;
+ (void)unUseFingerprintCurrentWallet:(Wallet *)wallet complete:(ResultBlock)complete;
+ (BOOL)canUseTouchID;
+ (void)touchVerificationComplete:(void(^)(TDTouchIDState state))complete;
///秘钥
+ (NSString*)decryptWallet:(Wallet*)wallet password:(NSString*)ppasswordwd;
+ (NSString*)encryptWalletPrivatekey:(NSString*)Privatekey password:(NSString*)password;
@end

NS_ASSUME_NONNULL_END
